package com.IntelligentCommunity.community.controller;

import com.IntelligentCommunity.common.core.domain.R;
import com.IntelligentCommunity.community.domain.EstateCount;
import com.IntelligentCommunity.community.domain.PopulationCount;
import com.IntelligentCommunity.community.domain.StatisticsData;
import com.IntelligentCommunity.community.service.StatisticsDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author：ZHP
 * @Package：com.IntelligentCommunity.community.controller
 * @Project：IntelligentCommunity
 * @name：StatisticsDataController
 * @Date：2024/7/21 12:00
 * @Filename：StatisticsDataController
 */
@RestController
@RequestMapping("/statistics")
public class StatisticsDataController {
    @Autowired
    private StatisticsDataService statisticsDataService;

    /**
     * 获取统计数据小区
     * @return
     */
    @GetMapping("/getStatisticsData")
    public R<StatisticsData> getStatisticsData(){
        return statisticsDataService.getStatisticsData();
    }
    /**
     * 查询统计详细数量实有设备
     */
    @GetMapping("/districtCount/{id}")
    public R districtCount(@PathVariable("id") Long id){
       return  R.ok(statisticsDataService.getDistrictCount(id));
    }
    /**
     * 查询人口类型统计详细数量
     */
    @GetMapping("/populationCount")
    public R<List<PopulationCount>> populationCount(){
        return  statisticsDataService.getPopulationCount();
    }

    /**
     * 查询统计详细数量
     * @return 结构体
     */
    @GetMapping("estateCount")
    public R<List<EstateCount>> estateCount(){
        return statisticsDataService.estateCount();
    }

}
